
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="UTF-8">
    <link href="/static/devtools30/layui/css/layui.css" rel="stylesheet" />
    <link href="/static/devtools30/css/devindexbase.css" rel="stylesheet" />
    <script src="/static/devtools30/js/jquery-1.11.2.min.js" type="text/javascript"></script>
    <script src="/static/devtools30/layui/layui.all.js" type="text/javascript"></script>
    <script src="/static/devtools30/js/devtoolCommon.js" type="text/javascript"></script>
    <script type="text/javascript" src="/static/devtools30/js/ajaxfileupload.js"></script>
    <title>导入</title>
    <style>
        /*页面内边距*/
        .addwrap {
            padding: 30px;
        }
        /*按钮组边框*/
        .layui-btn-primary {
            border: 1px solid #C9C9C9!important;
        }
        /*输入框高度*/
        .addwrap .layui-input,
        .layui-select {
            height: 25px;
        }

        .addwrap .layui-input-block {
            min-height: 26px;
            margin-left: 30px;
        }

        .addwrap .layui-form-label {
            padding: 0;
            text-align: right;
            height: 26px;
            line-height: 26px;
            width: 80px;
        }
        .layui-form-radio>i {
            font-size: 17px !important;
        }
        .layui-form-radio {
            line-height: 12px !important;
        }
        .layui-form-radio * {
            font-size: 12px;
        }
        .layui-form-item .layui-form-checkbox[lay-skin=primary] {
            margin-top: 3px !important;
        }
        .layui-form-checkbox span {

            font-size: 12px !important;
        }

        element.style {
        }
        .addwrap .layui-input, .layui-select {
            height: 25px;
        }
        .layui-form-select .layui-input {
            padding-right: 30px;
            cursor: pointer;
        }

    </style>
</head>
<body>



<div class="addwrap" style="text-align: center">
    <div class="container from-content">

    <form action="" class="layui-form"  >

            <input  type="hidden" name="excelId" id="excelId" th:value="${excelId}"/>
            <input  type="hidden" name="month" id="month" th:value="${month}"/>
            <input  type="hidden" name="year" id="year" th:value="${year}"/>

<!--            <div class="layui-inline" style=" margin-bottom: 16px;" >-->
<!--                <label class="layui-form-label" style="    width: 100px;">核算年月:</label>-->
<!--                <div class="layui-input-inline">-->
<!--                    <input type="text" class="layui-input" name="costdatatime" id="costdatatime" placeholder="yyyy-MM">-->
<!--                </div>-->
<!--            </div>-->

            <br/>

            <button type="button" class="layui-btn layui-btn-primary layui-border-blue" id="testList"><i class="layui-icon layui-icon-file"></i> 选择文件 </button>
            <button type="button" class="layui-btn layui-btn-primary layui-border-green" id="testListAction"><i class="layui-icon layui-icon-upload"></i> 开始上传 </button>

            <div id="loadtips" style="text-align: center; clear: both; color:#FF0000;display:none">
                数据导入中,请稍候...
            </div>

            <div class="layui-form-item">
                <div class=" flex flex-jusity-around tjbtn">
                    <button class="layui-btn layui-btn-radius layui-btn-sm layui-btn-primary" onclick="closeWin()">取消</button>
                </div>
            </div>
        </form>
    </div></div>
</body>

<script type="text/javascript">

    var type=null;

    layui.config({
        base: '/static/layui-v2.5.6/ext/',// 第三方模块所在目录
        version: 'v1.5.10' // 插件版本号
    });

    layui.use(["form",'laydate','upload'],function(){
        $=layui.jquery
        form=layui.form;

        layui.form.render("select")


        layui.laydate.render({
            elem: '#costdatatime'
            ,type: 'month'
        });
        layui.upload.render({
            elem: '#testList'
            ,url: '/DevtExcelImportController/upload'
            ,auto: false //选择文件后不自动上传
            ,bindAction: '#testListAction' //指向一个按钮触发上传
            ,accept: 'file'  //指定允许上传时校验的文件类型，可选值有：images（图片）、file（所有文件）、video（视频）、audio（音频）

            , done: function(res){
                console.log(res);
                if (res.success){
                    dlCommon.layerError(res.msg);
                    parent.searchBtn();

                }else {
                    dlCommon.layerError(res.msg);

                }
            },
            error: function(){
                //请求异常回调
            },before: function () {  //文件提交上传前的回调

                this.data = {  //传给后台的参数
                    excelId: $('input[name="excelId"]').val(),
                    month: $('input[name="month"]').val(),
                    year: $('input[name="year"]').val()
                };
            }
        });


    })
    function closeWin(){
        dlCommon.closeParentLayer();
    }
    function clearall() {
        var index = parent.layer.getFrameIndex(window.name); //获取当前窗体索引
        parent.layer.close(index); //执行关闭

    }





</script>

</html>
